home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
eflibpt4.zip
/
DEMO
/
STRINGS
/
TEXTCASE.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1996-08-16
|
1KB
|
42 lines
{ Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
Demonstration; text case conversion
EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
uses EFLIBDEF, EFLIBTXT, EFLIBBAS;
const Tests = 20000;
var TestString : string;
Timer : TimerObjectType;
Index : word;
procedure PascalUpperCase (var Data : string);
var Index : byte;
begin
for Index := 1 to Length(Data) do Data[Index] := UpCase(Data[Index]);
end;
begin
Timer.Initialize;
{ Generate a test string containing all ASCII characters }
TestString := '';
for Index := 1 to 255 do TestString := TestString + Chr(Index);
WriteLn ('Translating ', Tests*255, ' characters to upper case ...');
Write (' EFLIB upper case routine: ');
Timer.Reset; for Index := 1 to Tests do UpperCase(TestString);
WriteLn (Timer.ElapsedMS:4:0, ' [ms]');
Write (' Pascal upper case routine: ');
Timer.Reset; for Index := 1 to Tests do PascalUpperCase(TestString);
WriteLn (Timer.ElapsedMS:4:0, ' [ms]');
end.